function showTime(ff,d,h,m,s) {
    window.clearTimeout(time);	
   var timer1 = document.getElementById(d);
   var timer2 = document.getElementById(h);
   var timer3 = document.getElementById(m);
   var timer4 = document.getElementById(s);
	var timeend = new Date(ff).getTime();
	var timenow = new Date().getTime();
	var time_distance = timeend - timenow;
	if (time_distance > 0) {
		day = Math.floor(time_distance / 86400000);
		time_distance -= day * 86400000;
		hour = Math.floor(time_distance / 3600000);
		time_distance -= hour * 3600000;
		minute = Math.floor(time_distance / 60000);
		time_distance -= minute * 60000;
		second = Math.floor(time_distance / 1000);
      if(day<10){
         day='0'+day;
      }
		if (hour < 10)
			 hour = "0" + hour;
		if (minute < 10)
			minute = "0" + minute;
		if (second < 10)
			second = "0" + second;
		
		timer1.innerHTML=day;
		timer2.innerHTML=hour;
		timer3.innerHTML=minute;
		timer4.innerHTML=second;

		time=setTimeout(function() {
						showTime(ff,d,h,m,s)
		}, 1000);
	} else {
		timer1.innerHTML='00';
		timer2.innerHTML='00';
		timer3.innerHTML='00';
		timer4.innerHTML='00';
		//timer.innerHTML = '&nbsp00时00分00秒';
	}
}

